#pragma once

#include <string>
#include <xtd/exception>
#include "read_enum.h"

namespace icache {

typedef std::string string;

struct exception : xtd::exception {
	exception()	throw() { }
	exception(const string & msg) throw() : xtd::exception(msg)	{ }
};

typedef long long disc_size_type;

enum last_used_position {
	least_recently_used,
	dont_change_lru_position,
	most_recently_used,
	erase_element_as_unused
};

enum nearby {
	no_nearby = 0,
	backward = 1, 
	forward = 2,
	forward_n_backward = 3
};

enum deinterlace_fields {
	fields_off,
	fields_upper_first,
	fields_lower_first
};

enum deinterlace_method {
	method_duplicate,
	method_interpolate
};

// io

const char * const deinterlace_fields_str[] = 
	{"off", "upper_first", "lower_first", 0};

const char * const deinterlace_method_str[] = 
	{"duplicate", "interpolate", 0};

DEFINE_INLINE_ENUM_IO_OPERATORS(deinterlace_fields, deinterlace_fields_str);
DEFINE_INLINE_ENUM_IO_OPERATORS(deinterlace_method, deinterlace_method_str);

} //namespace icache
